package com.example.jlmodule.demo;

import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;


import java.util.HashMap;
import java.util.Map;

public class HttpClient {
//
    public String get(JLApiRequest jlApiRequest) {
        Object data = jlApiRequest.getData();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("head", JSON.toJSON(jlApiRequest));
        jsonObject.put("data", JSON.toJSON(data));
        Map<String, Object> map = new HashMap<>();
        map.put("reqData", jsonObject);
        return HttpUtil.get(jlApiRequest.getUrl(), map);
    }

}
